<%@page contentType="text/html" pageEncoding="UTF-8" import="java.util.List,
        java.util.ArrayList,
        gandalf.model.*,
        gandalf.controller.*"%>
<!DOCTYPE HTML>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="css/style.css" type="text/css" media="screen, projection">
        
       
        <title>JSP Page</title>
    </head>
    <%
                DogodekDao dogodekDao = new DogodekDao();
                CartJpaController cartDao = new CartJpaController();
                StrankaJpaController strankaDao = new StrankaJpaController();

                List<Dogodek> dogodki = new ArrayList<Dogodek>();
                dogodki = dogodekDao.all(false);

                Long idStranke = (Long) request.getSession().getAttribute("stranka_id");

                Stranka stranka = null;
                if (idStranke != null) {
                    stranka = strankaDao.findStranka(idStranke);
                }


                Long cartId = (Long) request.getSession().getAttribute("kosarica_id");
                Cart cart = null;
                if (cartId != null) {
                    cart = cartDao.findCart(cartId);
                }

    %>
    <body>
        <div id="header">
            <h1 id="logo">Gandalf</h1>
            <ul id="nav">
                <li><a href="index.jsp">Dogodki</a></li>
                <li><a href="mailto:gandalf_support@gmail.com">Kontakt</a></li>
                <li><a href="<%= stranka != null ? "logout.jsp" : "login.jsp"%>"><%= stranka != null ? "Odjava" : "Prijava"%></a></li>
            </ul>
        </div><!-- header -->
        <div id="section">

            <div id="who">
                <h2>1. Kontaktne informacije</h2>
                <ul>
                    <li>
                        <label class="kontaktInfo" for="ime">Ime:</label>
                        <input title="ime" type="text" value="<%= stranka != null ? stranka.getIme() : "Ime"%>" />
                    </li>
                    <li>
                        <label for="priimek" class="kontaktInfo">Priimek:</label>
                        <input title="priimek" type="text" value="<%= stranka != null ? stranka.getPriimek() : "Priimek"%>" />
                    </li>
                    <li>
                        <label for="naslov" class="kontaktInfo">Naslov:</label>
                        <input title="naslov" type="text" value="<%= stranka != null ? stranka.getNaslov() : "Naslov"%>" />
                    </li>
                    <li>
                        <label for="posta" class="kontaktInfo">Posta:</label>
                        <input title="posta" type="text" value="<%= stranka != null ? stranka.getKraj() : "Posta"%>" />
                    </li>
                    <li>
                        <label for="drzava" class="kontaktInfo">Država:</label>
                        <input title="drzava" type="text" value="<%= stranka != null ? stranka.getKraj() : "Država"%>" />
                    </li>
                    <li>
                        <label for="email" class="kontaktInfo">E-mail:</label>
                        <input title="email" type="text" value="<%= stranka != null ? stranka.getEmail() : "E-mail"%>" />
                    </li>
                </ul>

            </div>


            <div class="form-section" id="how">
                <form action="Placaj" method="POST">
                <h2>2. Način plačila</h2>
                    <ul>
                        <li>
                            <input type="radio" id="Card" value="Card" name="mf_cardtype" title="Card" checked="checked">
                            <label for="Card" id="cc-card">Visa / Mastercard / Discover / AMEX</label>
                            <input type="radio" id="PayPal" value="PayPal" name="mf_cardtype" title="PayPal">
                            <label for="PayPal" title="Pay with PayPal" id="cc-paypal">PayPal</label>
                        </li>
                        <li>
                            <label for="cardnumber" class="info">Št. kartice:</label>
                            <input name="cpi_card-number" id="cardnumber" type="text" title="The card number." class="required-card">
                        </li>

                        <li>
                            <label for="expiration-date" class="info">Veljavnost:</label>
                            <select name="cpi_card-month" title="The month your card expires.">
                                <option value="01">01</option>
                                <option value="02">02</option>
                                <option value="03">03</option>
                                <option value="04">04</option>
                                <option value="05">05</option>
                                <option value="06">06</option>
                                <option value="07">07</option>
                                <option value="08">08</option>
                                <option value="09">09</option>
                                <option value="10">10</option>
                                <option value="11">11</option>
                                <option value="12">12</option>
                            </select> /
                            <select name="cpi_card-year" title="The year your card expires.">
                                <option value="10">10</option>
                                <option value="11">11</option>
                                <option value="12">12</option>
                                <option value="13">13</option>
                                <option value="14">14</option>
                                <option value="15">15</option>
                                <option value="16">16</option>
                                <option value="17">17</option>
                                <option value="18">18</option>
                                <option value="19">19</option>
                                <option value="20">20</option>
                            </select>
                        </li>

                        <li>
                            <label for="cvv-code" class="info">Security Code:</label>
                            <input name="cpi_card-security" id="cvv-code" type="text" title="The card security code, found on the back of your card.">
                        </li>
                    </ul>

                <div id="submit-order">
                    <label for="Submit">Skupna cena<em><span id="order-total"><%= cart.getVsotaCene()%></span> EUR</em></label>
                    <div class="elist-signup">
                        <input type="hidden" name="listNew" value="e-coda">
                        <input type="checkbox" name="listSignup" value="true" checked="checked">
                        <label for="listSignup">Obveščaj me o spremembah!</label>
                    </div>

                    <input name="Submit" value="Placaj" title="Placaj" type="submit" id="progressButton">

                </div>


                </form>

            </div>
        </div>
    </body>
</html>
